/*
Minims .Net Playstation 3 UPNP ContentDirectory
Copyright (C) 2008  Guillaume Plourde

This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; version 2
of the License.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
*/

using System;
using System.Collections.Generic;
using System.Text;

namespace minims_lib
{
    public class RootDevice
    {
		/// <summary>
		/// Xml Description of the upnp root device.
		/// </summary>
		/// <returns>string</returns>
        static public string GetRootDeviceXml(ConfigManager conf)
        {
			StringBuilder DeviceXml = new StringBuilder();
			DeviceXml.Append("<?xml version=\"1.0\" encoding=\"utf-8\"?>");
			DeviceXml.Append("<root xmlns=\"urn:schemas-upnp-org:device-1-0\">");
			DeviceXml.Append("<specVersion>");
			DeviceXml.Append("<major>1</major>");
			DeviceXml.Append("<minor>0</minor>");
			DeviceXml.Append("</specVersion>");
			DeviceXml.Append("<device>");
			DeviceXml.Append("<UDN>uuid:" + conf.GetUniqueDeviceName + "</UDN>");
			DeviceXml.Append("<friendlyName>" + conf.GetFriendlyName + "</friendlyName>");
			DeviceXml.Append("<deviceType>urn:schemas-upnp-org:device:MediaServer:1</deviceType>");
			DeviceXml.Append("<manufacturer>Guillaume Plourde</manufacturer>");
			DeviceXml.Append("<manufacturerURL>" + conf.GetManufacturerURL + "</manufacturerURL>");
			DeviceXml.Append("<modelName>Windows Media Connect</modelName>");
			DeviceXml.Append("<modelNumber>4.0</modelNumber>");
			DeviceXml.Append("<modelURL>" + conf.GetManufacturerURL + "</modelURL>");
			DeviceXml.Append("<serialNumber>2008-08</serialNumber>");
			DeviceXml.Append("<serviceList>");
			DeviceXml.Append("<service>");
			DeviceXml.Append("<serviceType>urn:schemas-upnp-org:service:ContentDirectory:1</serviceType>");
			DeviceXml.Append("<serviceId>urn:upnp-org:serviceId:ContentDirectory</serviceId>");
			DeviceXml.Append("<SCPDURL>ContentDirectory/ContentDirectory.xml</SCPDURL>");
			DeviceXml.Append("<controlURL>ContentDirectory/control</controlURL>");
			DeviceXml.Append("<eventSubURL>ContentDirectory/event</eventSubURL>");
			DeviceXml.Append("</service>");
			DeviceXml.Append("<service>");
			DeviceXml.Append("<serviceType>urn:microsoft.com:service:X_MS_MediaReceiverRegistrar:1</serviceType>");
			DeviceXml.Append("<serviceId>urn:microsoft.com:serviceId:X_MS_MediaReceiverRegistrar</serviceId>");
			DeviceXml.Append("<SCPDURL>X_MS_MediaReceiverRegistrar/X_MS_MediaReceiverRegistrar.xml</SCPDURL>");
			DeviceXml.Append("<controlURL>X_MS_MediaReceiverRegistrar/control</controlURL>");
			DeviceXml.Append("<eventSubURL>X_MS_MediaReceiverRegistrar/event</eventSubURL>");
			DeviceXml.Append("</service>");
			DeviceXml.Append("</serviceList>");
			DeviceXml.Append("</device>");
			DeviceXml.Append("</root>");

			return DeviceXml.ToString();
        }
    }
}